package com.loanapp.server.app.webapp.controller.system;

import com.loanapp.base.common.dto.ResponseDto;
import com.loanapp.base.controller.common.BaseController;
import com.loanapp.base.controller.support.HttpKit;
import com.loanapp.server.app.webapp.constant.LoginValidate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.Map;

@RestController
public class LoginController extends BaseController {

    @LoginValidate
    @RequestMapping("/login")
    public ResponseDto Login(){
        ResponseDto result=ResponseDto.build("000","123");
     Map aa= HttpKit.ReadCookieMap(HttpKit.getRequest());
      result.setData(aa);
        return result;
    }

    @RequestMapping("/test")
    public void test() throws IOException {
            HttpKit.getResponse().sendRedirect("http://weikangqq.imwork.net:33584/main/login?phone=15972132723&pwd=123");
    //    HttpKit.getResponse().sendRedirect("http://localhost:7703/main/login?phone=15972132723&pwd=123");
    }
}
